import type {
  ProposalReportAddDTOType,
  ProposalReportUpdateDTOType,
  ProposalReportSearchDTOType
} from '@/resources/interface/proposalReport/ProposalReportTypes'
import type { ResultTypes } from '@/resources/interface/ResultTypes'
import { HttpResultUtil } from '@/apis/utils/HttpResultUtil'
import type { ProjectApplicationApi } from '@/apis/api/projectApplication/ProjectApplicationApi.ts'
import type {
  AuditApplicationDTOType
} from '@/resources/interface/projectApplication/ProjectApplicationTypes.ts'

export class ProposalReportApi {
  private static addUrl: string = '/proposalReport/add'
  private static updateUrl: string = '/proposalReport/update'
  private static searchUrl: string = '/proposalReport/search'
  private static deleteUrl: string = '/proposalReport/delete'
  private static auditUrl: string = 'proposalReport/audit'

  static audit(data: AuditApplicationDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitPost(this.auditUrl, data,true)
  }

  static add(data: ProposalReportAddDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitPost(this.addUrl, data,true)
  }

  static update(data: ProposalReportUpdateDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitPost(this.updateUrl, data,true)
  }

  static search(data: ProposalReportSearchDTOType): Promise<ResultTypes> {
    return HttpResultUtil.awaitPost(this.searchUrl, data,false)
  }

  static delete(idList: Array<number>): Promise<ResultTypes> {
    return HttpResultUtil.awaitPost(this.deleteUrl, idList,true)
  }
}
